package com.ubing.gxspringboot.gxproxy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class AOPJoinPoint implements  JoinPoint{
   private final Object target;
   private final Method method;
   private final Object[] args;

   public AOPJoinPoint(Object target, Method method, Object[] args) {
      this.target = target;
      this.method = method;
      this.args = args;
   }
   @Override
   public Object process(){
       Object invoke;
       try {
            invoke = this.method.invoke(this.target, this.args);
       } catch (IllegalAccessException|InvocationTargetException e) {
           throw new RuntimeException(e);
       }
       return invoke;
   }
}
